<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <style>
        body {
            font-family: Arial, sans-serif;
            margin: 20px;
        }
        .tab-container {
            display: flex;
            border-bottom: 1px solid #ccc;
        }
        .tab-button {
            background-color: inherit;
            border: none;
            outline: none;
            cursor: pointer;
            padding: 14px 16px;
            transition: 0.3s;
        }
        .tab-button:hover {
            background-color: #ddd;
        }
        .tab-content {
            display: none;
            padding: 6px 12px;
            border: 1px solid #ccc;
            border-top: none;
        }
        .active-tab {
            background-color: #ccc;
        }
        .active-content {
            display: block;
        }
    </style>
</head>
<body>

<div class="tab-container">
    <button class="tab-button active-tab" onclick="openTab(event, 'css')" style="display:flex;font-size: 20px"><img src="./img/css.png" style="width: 30px;height: 30px">CSS 属性</button>
    <button class="tab-button" onclick="openTab(event, 'component')" style="display:flex;font-size: 20px"><img src="./img/html.png" style="width: 30px;height: 30px">组件属性</button>
</div>

<div id="css" class="tab-content active-content">
    <iframe src="./csseditor.html" style="width:100%;height:1000px;overflow: auto; /* 添加滚动条 */">

    </iframe>
</div>

<div id="component" class="tab-content">
    <iframe src="./attreditor.html" style="width:100%;height:1000px;overflow: auto; /* 添加滚动条 */">

    </iframe>
</div>

<script>
    function openTab(evt, tabName) {
        var i, tabcontent, tablinks;
        tabcontent = document.getElementsByClassName("tab-content");
        for (i = 0; i < tabcontent.length; i++) {
            tabcontent[i].classList.remove("active-content");
        }
        tablinks = document.getElementsByClassName("tab-button");
        for (i = 0; i < tablinks.length; i++) {
            tablinks[i].classList.remove("active-tab");
        }
        document.getElementById(tabName).classList.add("active-content");
        evt.currentTarget.classList.add("active-tab");
    }
</script>

</body>
</html>


